/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbcostviat")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbcostviat.findAll", query = "SELECT p FROM Pyfntbcostviat p"),
    @NamedQuery(name = "Pyfntbcostviat.findByPyfntbcostviatid", query = "SELECT p FROM Pyfntbcostviat p WHERE p.pyfntbcostviatid = :pyfntbcostviatid"),
    @NamedQuery(name = "Pyfntbcostviat.findByNivel", query = "SELECT p FROM Pyfntbcostviat p WHERE p.nivel = :nivel"),
    @NamedQuery(name = "Pyfntbcostviat.findByDescripcion", query = "SELECT p FROM Pyfntbcostviat p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyfntbcostviat.findByZonaa", query = "SELECT p FROM Pyfntbcostviat p WHERE p.zonaa = :zonaa"),
    @NamedQuery(name = "Pyfntbcostviat.findByZonab", query = "SELECT p FROM Pyfntbcostviat p WHERE p.zonab = :zonab"),
    @NamedQuery(name = "Pyfntbcostviat.findByFecharegistro", query = "SELECT p FROM Pyfntbcostviat p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbcostviat.findByObservaciones", query = "SELECT p FROM Pyfntbcostviat p WHERE p.observaciones = :observaciones")})
public class Pyfntbcostviat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbcostviatid")
    private Integer pyfntbcostviatid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nivel")
    private String nivel;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "zonaa")
    private double zonaa;
    @Basic(optional = false)
    @NotNull
    @Column(name = "zonab")
    private double zonab;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbcostviatid")
    private Collection<Pyfntbpedviatic> pyfntbpedviaticCollection;

    public Pyfntbcostviat() {
    }

    public Pyfntbcostviat(Integer pyfntbcostviatid) {
        this.pyfntbcostviatid = pyfntbcostviatid;
    }

    public Pyfntbcostviat(Integer pyfntbcostviatid, String nivel, String descripcion, double zonaa, double zonab, Date fecharegistro) {
        this.pyfntbcostviatid = pyfntbcostviatid;
        this.nivel = nivel;
        this.descripcion = descripcion;
        this.zonaa = zonaa;
        this.zonab = zonab;
        this.fecharegistro = fecharegistro;
    }

    public Integer getPyfntbcostviatid() {
        return pyfntbcostviatid;
    }

    public void setPyfntbcostviatid(Integer pyfntbcostviatid) {
        this.pyfntbcostviatid = pyfntbcostviatid;
    }

    public String getNivel() {
        return nivel;
    }

    public void setNivel(String nivel) {
        this.nivel = nivel;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public double getZonaa() {
        return zonaa;
    }

    public void setZonaa(double zonaa) {
        this.zonaa = zonaa;
    }

    public double getZonab() {
        return zonab;
    }

    public void setZonab(double zonab) {
        this.zonab = zonab;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbpedviatic> getPyfntbpedviaticCollection() {
        return pyfntbpedviaticCollection;
    }

    public void setPyfntbpedviaticCollection(Collection<Pyfntbpedviatic> pyfntbpedviaticCollection) {
        this.pyfntbpedviaticCollection = pyfntbpedviaticCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbcostviatid != null ? pyfntbcostviatid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbcostviat)) {
            return false;
        }
        Pyfntbcostviat other = (Pyfntbcostviat) object;
        if ((this.pyfntbcostviatid == null && other.pyfntbcostviatid != null) || (this.pyfntbcostviatid != null && !this.pyfntbcostviatid.equals(other.pyfntbcostviatid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbcostviat[ pyfntbcostviatid=" + pyfntbcostviatid + " ]";
    }
    
}
